﻿using QD.PushManager.DB;
using QD.PushManager.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QD.PushManager.Manager
{
    /// <summary>
    /// 订阅宝产品内容操作
    /// </summary>
    public static class ProductDetailManager
    {
        public static int Add(ProductDetail model)
        {
            using (var db = new ShtDatabase())
            {
                return db.Insert(model) == null ? 0 : 1;
            }
        }

        public static int Update(ProductDetail model)
        {
            var sql = "update sql_s003.dbo.vIFO_Product_Detail set Details=@0 where FK_ProductId=@1";
            using (var db = new ShtDatabase())
            {
                return db.Execute(sql, model.Details, model.FK_ProductId);
            }
        }
    }
}